<template>
  <div>
    <div>我是孙组件 {{money}}</div>
    <button @click="changeMoney(50)">花50</button>
  </div>
</template>

<script>
import { onMounted, inject } from 'vue'
export default {
  name: 'GrandSon',
  setup (props, context) {
    const money = inject ('money')

    // 孙组件花50 通知祖先修改 单项数据流
    const changeMoney = inject ('changeMoney')

    return {money, changeMoney}
  }
}
</script>

<style>

</style>